<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="XdriveAPIEvent,com.xdrive.json.XdriveAPIEvent,API_FAILURE,API_RESULT,bytes,error,payload" name="keywords">
<title>com.xdrive.json.XdriveAPIEvent</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'XdriveAPIEvent - 'Xdrive ActionScript 3 Library'';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Xdrive ActionScript 3 Library</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?com/xdrive/json/XdriveAPIEvent.html&amp;com/xdrive/json/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;XdriveAPIEvent</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class XdriveAPIEvent"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.xdrive.json</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class XdriveAPIEvent</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">XdriveAPIEvent <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../images/inherit-arrow.gif"> flash.events.Event</td>
</tr>
</table>
<p></p>
  The XdriveAPIEvent class extends the flash.events.Event class.  
  <p>
  This event is broadcast with either a payload or error object upon the return of the JSON call. 
  Listen for the result or failure of this event to receive the response from the XdriveAPI method calls. 
  The XdriveAPIEvent event has modifies the Event class with additional parameters.
  </p>
  
  <p></p>
<br>
<span class="label">Example</span>
<br>This example demonstrates how the event can be used properly.
  
  <div class='listing'><pre>
     import com.xdrive.json.XdriveAPI;
     import com.xdrive.json.XdriveAPIEvent;
     import com.xdrive.json.XdriveAPIToken;
     import com.xdrive.json.vo.User;
    
     public function login():void
     {
         var service:XdriveAPI = new XdriveAPI();
         var user:User = new User();
             user.username = "username";
             user.password = "password";
  
         var token:XdriveAPIToken = service.login(user);
             token.addEventListener(XdriveAPIEvent.API_RESULT, result);
             token.addEventListener(XdriveAPIEvent.API_FAILURE, fault);
     }
  
     public function result( event : Object ) : void
     {      
         var resultEvent : XdriveAPIEvent = XdriveAPIEvent(event);
         var user:User = resultEvent.payload.user as User; 
         trace(user.firstname + "\n" + user.lastname);
     }
  
     public function fault( event : Object ) : void 
     {
         var faultEvent : XdriveAPIEvent = XdriveAPIEvent( event );
         trace(faultEvent.error.errorMessage + "\n" + faultEvent.error.errorCode); 
     }
  </pre></div>
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#API_FAILURE">API_FAILURE</a> : String = "API_FAILURE"<div class="summaryTableDescription">[static] XdriveAPIEvent type for API failure </div>
</td><td class="summaryTableOwnerCol">XdriveAPIEvent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#API_RESULT">API_RESULT</a> : String = "API_RESULT"<div class="summaryTableDescription">[static] XdriveAPIEvent type for API results </div>
</td><td class="summaryTableOwnerCol">XdriveAPIEvent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#bytes">bytes</a> : ByteArray<div class="summaryTableDescription">[read-only]</div>
</td><td class="summaryTableOwnerCol">XdriveAPIEvent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#error">error</a> : <a href="../json/XdriveAPIError.html">XdriveAPIError</a>
<div class="summaryTableDescription">[read-only]</div>
</td><td class="summaryTableOwnerCol">XdriveAPIEvent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#payload">payload</a> : Object<div class="summaryTableDescription">[read-only]</div>
</td><td class="summaryTableOwnerCol">XdriveAPIEvent</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#XdriveAPIEvent()">XdriveAPIEvent</a>(type:String, payload:Object, bytes:ByteArray, error:<a href="XdriveAPIError.html">XdriveAPIError</a>, bubbles:Boolean = false)</div>
<div class="summaryTableDescription">
   XdriveAPIEvent method for listening to the API result and failure events.</div>
</td><td class="summaryTableOwnerCol">XdriveAPIEvent</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="API_FAILURE"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">API_FAILURE</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public static var API_FAILURE:String = "API_FAILURE"</code><p> XdriveAPIEvent type for API failure </p></div>
<a name="API_RESULT"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">API_RESULT</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static var API_RESULT:String = "API_RESULT"</code><p> XdriveAPIEvent type for API results </p></div>
<a name="bytes"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">bytes</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>bytes:ByteArray</code>&nbsp;&nbsp;[read-only]<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get bytes():ByteArray</code>
<br>
</div>
<a name="error"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">error</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>error:<a href="../json/XdriveAPIError.html">XdriveAPIError</a></code>&nbsp;&nbsp;[read-only]<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get error():<a href="../json/XdriveAPIError.html">XdriveAPIError</a></code>
<br>
</div>
<a name="payload"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">payload</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>payload:Object</code>&nbsp;&nbsp;[read-only]<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get payload():Object</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="XdriveAPIEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">XdriveAPIEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function XdriveAPIEvent(type:String, payload:Object, bytes:ByteArray, error:<a href="XdriveAPIError.html">XdriveAPIError</a>, bubbles:Boolean = false)</code><p>
   XdriveAPIEvent method for listening to the API result and failure events.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">type</span>:String</code> &mdash; <code>XdriveAPIEvent.API_RESULT</code> or <code>XdriveAPIEvent.API_FAILURE</code>
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">payload</span>:Object</code> &mdash; Object containing the name of the object returned on the XdriveAPI method
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">bytes</span>:ByteArray</code> &mdash; ByteArray containing used from progress events such as upload and download, any time bytes are streamed
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">error</span>:<a href="XdriveAPIError.html">XdriveAPIError</a></code> &mdash; XdriveAPIError object containing error information on failure
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">bubbles</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Boolean value for making the event bubble
   </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
